package org.example.test.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.example.common.entity.AbstractEntity;

import javax.persistence.*;
import java.util.List;

/**
 * @author jzq
 * @date 2022/8/19 13:38
 */
@SuppressWarnings({"all"})
@Data
@Entity
@Table(name = "test_school")
public class School extends AbstractEntity {

    private String name;

    @Column(columnDefinition = "text")
    private String description;

    @OneToMany(cascade = CascadeType.ALL,mappedBy = "school",fetch = FetchType.EAGER)
    @JsonIgnore
    private List<Clazz> clazzes;

    @Transient
    private String code;

}
